package com.math.vod.controller;

import com.math.vod.common_utils.R;
import com.math.vod.service.VodService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/showoss/vod")
@CrossOrigin
public class VodController {
    @Autowired
    private VodService vodService;

    @PostMapping("uploadVideo")
    public R uploadAlyiVideo(MultipartFile file) throws Exception {
        String videoId = vodService.uploadVideoAly(file);
        return R.ok().message("视频上传成功").data("videoId", videoId);
    }
}
